package com.diandi.messages.service.impl.freeSign;

import com.diandi.messages.bean.freeSign.MsgFreeSign;
import com.diandi.messages.manager.freeSign.MsgFreeSignManager;
import com.diandi.messages.mapper.freeSign.MsgFreeSignMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by mxp on 2017/10/29.
 */
@Component
public class MsgFreeSignManagerImpl implements MsgFreeSignManager {

    @Autowired
    private MsgFreeSignMapper msgFreeSignMapper;

    @Override
    public MsgFreeSign querySingle(String freeSignId, Integer status) {

        if (StringUtils.isBlank(freeSignId)){
            return null;
        }

        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("freeSignId", freeSignId);
        paramMap.put("status", status);

        return msgFreeSignMapper.querySingle(paramMap);
    }
}
